<?php
 namespace app\index\controller;
 use app\index\controller\BaseController;
 use think\Db;
 
 
class NewsController extends BaseController {
 	 public function index(){
 		$list=db('news')->order('add_time desc')->select();
		$this->assign('list',$list);
		return  $this->fetch();
 	 }
 	 public function show(){
 	 	dump(input('id'));
 	 	
 	 	$show=db('news')->alias('a')->join('newstype b','a.cart_id=b.id')->where('a.id',input('id'))->find();
 	 	$count=$show['clock']+1;
 	 	$list=db('news')->where('id',input('id'))->update(['clock'=>$count]);
 	 	$this->assign('show',$show);
 	 	return $this->fetch();
 	}
 }
?>